package com.dylan.历史.跟书.effectivejava.item01服务提供者框架;

/**
 * @author : ankang
 * @date : 2019/5/26 21:07
 * @Description :
 */
public class ServiceTest {

    public static void main(String[] args) {
        // 注册服务
        Services.registerProvider("drive", new Provider() {
            @Override
            public Service newService() {
                return new DriveService();
            }
        });
        // -------------------------
        Service service = Services.newInstance("drive");
        service.doSomeService();
    }
}
